import account from './account';
import store from './store';

export const homeUrl = '/code';

const safeRoutes = [
  // 兜底
  {
    path: '/',
    access: 'canRead',
    redirect: '/code/store',
    hideInMenu: true,
  },
  { component: './Exception/404', hideInMenu: true },
];

export const mainRoutes = [
  // canLogin权限的放这里
  {
    path: '/login',
    hideInMenu: true,
    layout: false,
    access: 'canLogin',
    component: './Login',
  },
  {
    path: '/',
    access: 'canRead',
    component: '@/layouts',
    routes: [
      {
        path: '/',
        access: 'canRead',
        component: '@/layouts/SecLayout',
        routes: [...store, ...account],
      },
    ],
  },
  {
    path: '*',
    access: 'canRead',
    component: './Exception/404',
  },
  {
    path: '/landing',
    hideInMenu: true,
    layout: false,
    access: 'canLogin',
    component: './Landing',
  },
];

export const routes = [...mainRoutes, ...safeRoutes];

export const mainMenuList = mainRoutes[1].routes[0].routes;

// 不需要二级菜单的路由放这里
export const withoutSecMenuRoutes = ['/'];
